3.905 \(\int \frac{4+x}{(5+4 x+x^2)^2} \, dx\)

Optimal. Leaf size=24 \[ \frac{2 x+3}{2 \left (x^2+4 x+5\right )}+\tan ^{-1}(x+2) \]

[Out]

(3 + 2*x)/(2*(5 + 4*x + x^2)) + ArcTan[2 + x]

________________________________________________________________________________________

Rubi [A]  time = 0.0085993, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {638, 618, 204} \[ \frac{2 x+3}{2 \left (x^2+4 x+5\right )}+\tan ^{-1}(x+2) \]

Antiderivative was successfully verified.

[In]

Int[(4 + x)/(5 + 4*x + x^2)^2,x]

[Out]

(3 + 2*x)/(2*(5 + 4*x + x^2)) + ArcTan[2 + x]

Rule 638

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b*d - 2*a*e + (2*c*d -
b*e)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c)), x] - Dist[((2*p + 3)*(2*c*d - b*e))/((p + 1)*(b^2
- 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[2*c*d - b*e, 0] && NeQ[b^
2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{4+x}{\left (5+4 x+x^2\right )^2} \, dx &=\frac{3+2 x}{2 \left (5+4 x+x^2\right )}+\int \frac{1}{5+4 x+x^2} \, dx\\ &=\frac{3+2 x}{2 \left (5+4 x+x^2\right )}-2 \operatorname{Subst}\left (\int \frac{1}{-4-x^2} \, dx,x,4+2 x\right )\\ &=\frac{3+2 x}{2 \left (5+4 x+x^2\right )}+\tan ^{-1}(2+x)\\ \end{align*}

Mathematica [A]  time = 0.0108832, size = 24, normalized size = 1. \[ \frac{2 x+3}{2 \left (x^2+4 x+5\right )}+\tan ^{-1}(x+2) \]

Antiderivative was successfully verified.

[In]

Integrate[(4 + x)/(5 + 4*x + x^2)^2,x]

[Out]

(3 + 2*x)/(2*(5 + 4*x + x^2)) + ArcTan[2 + x]

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 23, normalized size = 1. \begin{align*}{\frac{4\,x+6}{4\,{x}^{2}+16\,x+20}}+\arctan \left ( 2+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((4+x)/(x^2+4*x+5)^2,x)

[Out]

1/4*(4*x+6)/(x^2+4*x+5)+arctan(2+x)

________________________________________________________________________________________

Maxima [A]  time = 1.6477, size = 30, normalized size = 1.25 \begin{align*} \frac{2 \, x + 3}{2 \,{\left (x^{2} + 4 \, x + 5\right )}} + \arctan \left (x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+4*x+5)^2,x, algorithm="maxima")

[Out]

1/2*(2*x + 3)/(x^2 + 4*x + 5) + arctan(x + 2)

________________________________________________________________________________________

Fricas [A]  time = 1.57199, size = 88, normalized size = 3.67 \begin{align*} \frac{2 \,{\left (x^{2} + 4 \, x + 5\right )} \arctan \left (x + 2\right ) + 2 \, x + 3}{2 \,{\left (x^{2} + 4 \, x + 5\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+4*x+5)^2,x, algorithm="fricas")

[Out]

1/2*(2*(x^2 + 4*x + 5)*arctan(x + 2) + 2*x + 3)/(x^2 + 4*x + 5)

________________________________________________________________________________________

Sympy [A]  time = 0.193603, size = 19, normalized size = 0.79 \begin{align*} \frac{2 x + 3}{2 x^{2} + 8 x + 10} + \operatorname{atan}{\left (x + 2 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x**2+4*x+5)**2,x)

[Out]

(2*x + 3)/(2*x**2 + 8*x + 10) + atan(x + 2)

________________________________________________________________________________________

Giac [A]  time = 1.25279, size = 30, normalized size = 1.25 \begin{align*} \frac{2 \, x + 3}{2 \,{\left (x^{2} + 4 \, x + 5\right )}} + \arctan \left (x + 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((4+x)/(x^2+4*x+5)^2,x, algorithm="giac")

[Out]

1/2*(2*x + 3)/(x^2 + 4*x + 5) + arctan(x + 2)